package com.hangzhou.xyj.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.hangzhou.xyj.model.base.BaseModel;
import com.j256.ormlite.field.DatabaseField;

/**
 * Created by neo.duan on 2016/1/6.
 * 戏曲数据结构
 */
public class DramaModel extends BaseModel {

    public static final String _ID = "_id";
    public static final String DRAMA_ID = "drama_id";
    public static final String NAME = "_name";
    public static final String ACCOMPANY_URL = "_accompanyUrl";
    public static final String NATIVE_URL = "_nativeUrl";
    public static final String LRC_URL = "_lrcUrl";
    public static final String MIXER_FILE_PATH = "_mixerFilePath";
    public static final String CREATE_TIME = "_createTime";
    public static final String DURATION = "_duration";

    //预留字段:用于数据库
    public static final String DATA0 = "_data0";
    public static final String DATA1 = "_data1";
    public static final String DATA2 = "_data2";
    public static final String DATA3 = "_data3";
    public static final String DATA4 = "_data4";
    public static final String DATA5 = "_data5";
    public static final String DATA6 = "_data6";
    public static final String DATA7 = "_data7";

    //预留字段
    @DatabaseField(columnName = DATA0)
    private String data0;
    @DatabaseField(columnName = DATA1)
    private String data1;
    @DatabaseField(columnName = DATA2)
    private String data2;
    @DatabaseField(columnName = DATA3)
    private String data3;
    @DatabaseField(columnName = DATA4)
    private String data4;
    @DatabaseField(columnName = DATA5)
    private String data5;
    @DatabaseField(columnName = DATA6)
    private String data6;
    @DatabaseField(columnName = DATA7)
    private String data7;


    @DatabaseField(generatedId = true, columnName = _ID)
    @Expose
    private int _id;

    @DatabaseField(columnName = DRAMA_ID)
    private int id;//戏曲唯一标识

    @DatabaseField(columnName = NAME)
    private String name; //戏曲名称

    @DatabaseField(columnName = ACCOMPANY_URL)
    @SerializedName("pre_url")
    private String accompanyUrl; //伴奏

    @DatabaseField(columnName = NATIVE_URL)
    @SerializedName("url")
    private String nativeUrl; //原唱url

    @DatabaseField(columnName = LRC_URL)
    @SerializedName("sing_word")
    private String lrcUrl; //歌词url

    @DatabaseField(columnName = MIXER_FILE_PATH)
    private String mixerFilePath; //混音文件路径,只有混音了才有值为保存本地的路径

    @DatabaseField(columnName = CREATE_TIME)
    private long createTime; //创建时间

    @DatabaseField(columnName = DURATION)
    private long duration; //时长
    private String shareContent;//分享的内容

    private String sortLetters;  //显示数据拼音的首字母
    private boolean isSelected; //是否选中

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNativeUrl() {
        return nativeUrl;
    }

    public void setNativeUrl(String nativeUrl) {
        this.nativeUrl = nativeUrl;
    }

    public String getLrcUrl() {
        return lrcUrl;
    }

    public void setLrcUrl(String lrcUrl) {
        this.lrcUrl = lrcUrl;
    }

    public String getSortLetters() {
        return sortLetters;
    }

    public void setSortLetters(String sortLetters) {
        this.sortLetters = sortLetters;
    }

    public String getShareContent() {
        return shareContent;
    }

    public void setShareContent(String shareContent) {
        this.shareContent = shareContent;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setIsSelected(boolean isSelected) {
        this.isSelected = isSelected;
    }

    public String getAccompanyUrl() {
        return accompanyUrl;
    }

    public void setAccompanyUrl(String accompanyUrl) {
        this.accompanyUrl = accompanyUrl;
    }

    public String getMixerFilePath() {
        return mixerFilePath;
    }

    public void setMixerFilePath(String mixerFilePath) {
        this.mixerFilePath = mixerFilePath;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    @Override
    public String toString() {
        return "DramaModel{" +
                "_id=" + _id +
                ", id=" + id +
                ", name='" + name + '\'' +
                ", accompanyUrl='" + accompanyUrl + '\'' +
                ", nativeUrl='" + nativeUrl + '\'' +
                ", lrcUrl='" + lrcUrl + '\'' +
                ", mixerFilePath='" + mixerFilePath + '\'' +
                ", createTime=" + createTime +
                ", duration=" + duration +
                ", sortLetters='" + sortLetters + '\'' +
                ", isSelected=" + isSelected +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof DramaModel)
            return ((DramaModel) o).getId() == this.getId();
        else return false;
    }
}
